package ysc.cqnu.operdb.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import ysc.cqnu.operdb.entity.ResultData;
import ysc.cqnu.operdb.serviceImpl.ZZQinYouInfoInsertServiceImpl;

@CrossOrigin
@Controller
@ResponseBody
public class ZZDQinYouInfoController {
    @Autowired
    private ResultData resultData;
    @Autowired
    private ZZQinYouInfoInsertServiceImpl zzQinYouInfoInsertService;
    //    插入表中
    @RequestMapping(value = "/insertqinyouinfoZZ",method = RequestMethod.POST)
    public ResultData insertqinyouinfoZZ(@RequestParam(value = "qinyou") String qinyou, @RequestParam(value = "renwu") String renwu, @RequestParam(value = "yongtu") String yongtu,
                                          @RequestParam(value = "juti") String juti, @RequestParam(value = "tupian") MultipartFile tupian, @RequestParam(value = "shipin") MultipartFile shipin,
                                          @RequestParam(value = "miaoshu")String miaoshu, @RequestParam(value = "uploader") String uploader){
        System.out.println("清油预览前端已连接");
        resultData = zzQinYouInfoInsertService.zZQinYouInfoInsertService(qinyou,renwu,yongtu,juti,tupian,shipin,miaoshu,uploader);
        return resultData;
    }
}
